<div class='modal fade' id='sendBookingsEmailModal' tabindex='-1' role='dialog' aria-labelledby='sendBookingsEmailModalLabel'>
  <div class='modal-dialog modal-lg' role='document'>
    <div class='modal-content'>
      <div class='modal-header'>
        <h5 class='modal-title' id='sendBookingsEmailModalLabel'><i class='fas fa-fw fa-envelope'></i>{{ 'Send an email to users who booked this resource'|trans }}</h5>
        <button type='button' class='close' data-dismiss='modal' aria-label='{{ 'Close'|trans }}'>
          <span aria-hidden='true'>&times;</span>
        </button>
      </div>
      <form id='notifySurroundingBookersForm' aria-label='{{ 'Send an email to users who booked this resource'|trans }}'>
        <div class='modal-body'>
          <p>{{ 'Recipients are users with bookings up to 4 months past or future.'|trans }}</p>
          {% if surroundingBookers|length == 0 %}
            <p>{{ 'There are no bookings associated with this resource.'|trans|msg('warning', false) }}</p>
          {% else %}
            <p>{{ 'Email will be sent to %d users.'|trans|format(surroundingBookers|length) }}</p>
          {% endif %}
          {# SUBJECT #}
          <label for='bookingsEmailSubject' class='col-form-label'>{{ 'Subject'|trans }}</label>
          <input class='form-control' {{ surroundingBookers|length == 0 ? 'disabled' }} name='subject' type='text' id='bookingsEmailSubject' size='45' required maxlength='200'/>
          {# BODY #}
          <label for='bookingsEmailBody' class='col-form-label mt-2'>{{ 'Message'|trans }}</label>
          <textarea class='form-control' {{ surroundingBookers|length == 0 ? 'disabled' }} name='body' id='bookingsEmailBody' maxlength='9000'></textarea>
        </div>
        <div class='modal-footer'>
          <button type='button' class='btn btn-ghost' data-dismiss='modal'>{{ 'Cancel'|trans }}</button>
          <button type='submit' {{ surroundingBookers|length == 0 ? 'disabled' }} class='btn btn-primary' data-action='notify-surrounding-bookers'>{{ 'Send'|trans }}</button>
        </div>
      </form>
    </div>
  </div>
</div>
